package com.lock;

/**
 * @author: csh
 * @Date: 2021/12/16 22:31
 * @Description:
 */
public class StaticDeadLockMain {

    public static void main(String[] args) {

    }

}

class StaticA{
    static  {
        try {
            Thread.sleep(1000);
        }catch (InterruptedException e){

        }
        try {
            Class.forName("com.hong.lock.StaticB");
        }catch (ClassNotFoundException e){
            e.printStackTrace();
        }
        System.out.println("staticA init ok");
    }
}

class StaticB{
    static  {
        try {
            Thread.sleep(1000);
        }catch (InterruptedException e){

        }
        try {
            Class.forName("com.hong.lock.StaticA");
        }catch (ClassNotFoundException e){
            e.printStackTrace();
        }
        System.out.println("staticB init ok");
    }
}
